﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WindowsFormsMessageGlobal.Funcs
{
    public class MessageManager
    {
        private static MessageManager _instance;

        public static MessageManager Instance
        {
            get
            {
                if (_instance == null)
                {
                    _instance = new MessageManager();
                }
                return _instance;
            }
        }
        public event Action<Message> MessageReceived;

        public void SendMessage(Message message)
        {
            // 触发消息事件
            MessageReceived?.Invoke(message);
        }
    }
}
